<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>
        <div style="color: deepskyblue;float: left;padding: 20px 20px;">
   
  <?php
  $n=5; //金字塔行数
for($i=1;$i<=$n;$i++){
    //在打印*之前，先打印空格
    for($k=1;$k<=$n-$i;$k++){
        echo"&nbsp;";
    }
    //内层控制每层*的个数
    for($j=1;$j<=2*$i-1;$j++){
        echo"*";
    }
    echo"<br/>";
}
 ?></div>

 <div style="color:red;float: left;padding: 20px 20px;"><?php 
for($a=0;$a<5;$a++){

 for($d=11;$d>$a+1;$d--){

   echo " "; 
  }

 for($b=0;$b<($a+1)*2-1;$b++){   

   echo "*";

  }  
  echo "<br>";
  }
  ?></div>
    </body>
</html>
